package net.oschina.gpg.dao;

import com.github.pagehelper.PageHelper;
import net.oschina.gpg.bo.Question;
import net.oschina.gpg.mapper.QuestionMapper;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with bluescreen
 *
 * @author ; gpg(gpg512@sina.cn)
 *         DATE:2016/10/19
 */
@Component
public class QuestionDao {

    @Autowired
    QuestionMapper questionMapper;

    public List<Question> findQuestionsByPage(int page){
        return questionMapper.selectByRowBounds(null, new RowBounds((page - 1) * 10 +1 , page * 10));
    }
}
